package com.intramirror.product.service;

import com.intramirror.product.entity.AggregateRule;
import com.intramirror.product.entity.Product;
import com.intramirror.product.entity.Spu;
import com.intramirror.product.entity.SpuBoutiqueImgSort;
import com.intramirror.product.entity.SpuInexactProduct;
import com.intramirror.product.exception.BusinessException;
import java.util.List;

/**
 * Created on 2018/1/26.
 * @author 123
 */

public interface IAggregateService {
    List<AggregateRule> listAllAggregateRule();

    List<Product> getUnAggregatedProduct(Long productId, int pos, int limit);

    Spu aggregateProduct(Product product) throws BusinessException;

    List<SpuBoutiqueImgSort> listAllBoutiqueImgSort();

    Spu aggregateProductToNewSpu(Long productId, String designerId, String colorCode);

    Product selectByPrimaryKey(Long productId);

    void insertSpuInexactProduct(SpuInexactProduct spuInexactProduct);

    Spu aggregateToExistsSpu(Product product) throws BusinessException;

    /**
     * 查询在聚合规则内（vendorId、brandId）未聚合的商品
     * @param productId
     * @param pos
     * @param limit
     * @param vendorId
     * @param brandIds
     * @return
     */
    List<Product> getUnAggregatedProductInRule(Long productId, int pos, int limit, Long vendorId, List<Long> brandIds);

    /**
     * 根据product更新spu boutiqueImg
     * @param product
     * @param spu
     */
    void updateBoutiqueSpuImg(Product product, Spu spu);
}
